package com.example.mapper;

import com.example.pojo.bo.SearchBO;
import com.example.pojo.entity.Search;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 本文来演示
 *
 * @author 赵建云
 * @create 2023/10/14
 */
public interface SearchMapper {
    @Insert("insert into search(js_id, search_keyword, search_time) value(#{jsId},#{searchKeyword},#{searchTime})")
    int saveSearch(Search search);
    @Select("select id,search_keyword from search where js_id = #{value}")
    List<SearchBO> searchKeyword(Integer jsId);
    @Update("update search set search_time=now() where id=#{value}")
    int updateSearch(Integer id);
}
